/*
 * MyInputManager.h
 *
 *  Created on: 15 Oct 2013
 *      Author: Patrick
 */

#ifndef MYINPUTMANAGER_H_
#define MYINPUTMANAGER_H_

#include <OgreRenderWindow.h>

#include <OISEvents.h>
#include <OISInputManager.h>
#include <OISKeyboard.h>
#include <OISMouse.h>

class MyInputManager: public OIS::KeyListener, OIS::MouseListener {
public:
	MyInputManager(OIS::ParamList paramList, Ogre::RenderWindow* renderWnd);
	virtual ~MyInputManager();

	OIS::Mouse* GetMouse();
	OIS::Keyboard* GetKeyboard();

	bool isKeyDown(OIS::KeyCode key) const;
	void captureInput();

	void registerKeyListener(OIS::KeyListener* listener);
	void registerMouseListener(OIS::MouseListener* listener);

private:
	bool keyPressed(const OIS::KeyEvent &keyEventRef);
	bool keyReleased(const OIS::KeyEvent &keyEventRef);

	bool mouseMoved(const OIS::MouseEvent &evt);
	bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
	bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id);

	OIS::InputManager* m_pInputMgr;
	OIS::Keyboard* m_pKeyboard;
	OIS::Mouse* m_pMouse;
	std::vector<OIS::KeyListener*> keyListeners;
	std::vector<OIS::MouseListener*> mouseListeners;
};

#endif /* MYINPUTMANAGER_H_ */
